package com.hu.system.domain;

/**
 * 产品操作结果
 * 用于导入时返回产品的操作类型
 *
 * @author hu
 */
public class ProductOperationResult {
    
    /**
     * 产品信息
     */
    private ProductInfo product;
    
    /**
     * 操作类型：CREATED-新建, UPDATED-更新, UNCHANGED-无变化
     */
    private OperationType operationType;
    
    /**
     * 更新的字段描述（仅在UPDATED时有值）
     */
    private String updateDescription;
    
    public enum OperationType {
        CREATED,    // 新建
        UPDATED,    // 更新
        UNCHANGED   // 无变化
    }
    
    public ProductOperationResult(ProductInfo product, OperationType operationType) {
        this.product = product;
        this.operationType = operationType;
    }
    
    public ProductOperationResult(ProductInfo product, OperationType operationType, String updateDescription) {
        this.product = product;
        this.operationType = operationType;
        this.updateDescription = updateDescription;
    }
    
    public ProductInfo getProduct() {
        return product;
    }
    
    public void setProduct(ProductInfo product) {
        this.product = product;
    }
    
    public OperationType getOperationType() {
        return operationType;
    }
    
    public void setOperationType(OperationType operationType) {
        this.operationType = operationType;
    }
    
    public String getUpdateDescription() {
        return updateDescription;
    }
    
    public void setUpdateDescription(String updateDescription) {
        this.updateDescription = updateDescription;
    }
}

